#include "tool_resource.h"

void reLoadResource(std::vector<std::string> *Table)
{
	int i;
	NSString *_String;

	for (i = 0; i < Table->size(); i++)
	{
		_String = [NSString stringWithFormat:@"%s.plist", (*Table)[i].c_str()];
		[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:_String];
		_String = [NSString stringWithFormat:@"%s.png", (*Table)[i].c_str()];
		[[CCTextureCache sharedTextureCache] addImage:_String];
	}
}

void reFreeResource(std::vector<std::string> *Table)
{
	int i;
	NSString *_String;

	for (i = 0; i < Table->size(); i++)
	{
		_String = [NSString stringWithFormat:@"%s.plist", (*Table)[i].c_str()];
		[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile:_String];
		_String = [NSString stringWithFormat:@"%s.png", (*Table)[i].c_str()];
		[[CCTextureCache sharedTextureCache] removeTextureForKey:_String];
	}
}